package com.personal.model.base;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
public class BaseEntity implements Serializable {

    @TableField(exist = false)
    private String searchValue;

    @Excel(name ="创建时间", exportFormat = "yyyy-MM-dd HH:mm:ss", width = 15)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private String createBy;

    private String updateBy;

//    @TableLogic  //逻辑删除 默认效果 0 没有删除 1 已经删除

    @TableField(exist = false)
    private Integer isDeleted;

    @TableField(exist = false)
    private Date beginTime;
    @TableField(exist = false)
    private Date endTime;

    @TableField(exist = false)
    private String remark;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();
}
